from urllib import request
from urllib import parse

url = "http://httpbin.org/post"
headers = {
	"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
}

data_bytes = parse.urlencode({
	"name": "qiku"
}).encode()

req = request.Request(url, data=data_bytes,  method="POST", headers=headers)
print(req.full_url)
print(req.method)
print(req.headers)

# 发起请求
res = request.urlopen(req)
print(res.read().decode())
